/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package es.udc.emarketapp.emarket.model.usersFacade.actions;

import es.udc.emarketapp.emarket.model.client.dao.SQLClientDAO;
import es.udc.emarketapp.emarket.model.client.dao.SQLClientDAOFactory;
import es.udc.fbellas.j2ee.util.exceptions.InstanceNotFoundException;
import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import es.udc.fbellas.j2ee.util.sql.NonTransactionalPlainAction;
import java.sql.Connection;

public class FindClientByIdAction implements NonTransactionalPlainAction {

	private String idClient;

	public FindClientByIdAction(String idClient) {

		this.idClient = idClient;
	}

	public Object execute(Connection connection)
			throws InstanceNotFoundException, InternalErrorException {

		SQLClientDAO clienteDAO = SQLClientDAOFactory.getDAO();

		return clienteDAO.findById(connection, idClient);
	}
}
